<?
	class diaoconline extends get_articles
	{		
		function removeBot($html){return removeDiaOc($html, "p[align=right]", "div i b");}
		function removeDiaOc($html, $selector, $selector2)
		{	
			$str = '';
			$str2 = '';			
			$html = str_get_html($html);			
			foreach ($html->find($selector) as $node)
			{
				$str = $node->innertext;
			}
			foreach ($html->find($selector2) as $node)
			{
				$str2 = $node->innertext;
			}	   
			$rs = str_replace($str, '',$html->innertext);
			
			return str_replace($str2, '',$rs);
		}
		// Get Link Input Stack
		function getHTMLNewListLandStack($link_new, $TheDivBig, $TheDivList, $cid)
		{
			//$link_new = 'http://www.diaoconline.vn/tin-tuc/tin-dia-oc/1/';	
			//$TheDivBig = 'div[class="NewsTopDetail"]';
			//$TheDivList = 'div[class="ListTin"] ul li';
			//$cid = 758;
			$index = 1;
			$arrLink[0]['cid'] = $cid;
			
			// Create DOM from URL or file
			$html = file_get_html($link_new);	
			
			//Find Article New Big
			$html_big = $html->find($TheDivBig, 0);
			$arrLink[0]['link'] = $html_big->find('a', 0)->href;
			$arrLink[0]['title'] = $html_big->find('h3 a', 0)->plaintext;	
			$arrLink[0]['short'] = $html_big->find('p', 1)->plaintext;		
				
			// Find Article New List	
			foreach($html->find($TheDivList) as $element)
			{
				$arrLink[$index]['link'] = $element->find('a', 0)->href;
				$arrLink[$index]['cid'] = $cid;
				$arrLink[$index]['title'] = htmlspecialchars($element->find('div[class="ListTinTitle"] a', 0)->plaintext);
				$arrLink[$index]['short'] = htmlspecialchars($element->find('div[class="ListTinText"]', 0)->plaintext);
				$arrLink[$index]['update'] = $element->find('div[class="ListTinUpdate"]', 0)->plaintext;
				
				$index ++;
			}		
			
			//print_r($arrLink);
			SaveLinkInputData($arrLink);
		}
	}
?>